const { EventEmitter } = require('events')

const myEmitter = new EventEmitter()

myEmitter.on('message', function() {
    console.log('我被触发了')
})

myEmitter.emit('message')